﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace QLThuVien
{
    public partial class frTimKiemDocGia : Form
    {
        public frTimKiemDocGia()
        {
            InitializeComponent();
        }
        void load_listview()
        {
            listView1.Columns.Add("STT", 80, HorizontalAlignment.Center);
            listView1.Columns.Add("Mã độc giả", 120, HorizontalAlignment.Center);
            listView1.Columns.Add("Họ Tên", 190, HorizontalAlignment.Center);
            listView1.Columns.Add("Đối Tượng", 160, HorizontalAlignment.Center);
            listView1.Columns.Add("Giới Tính", 140, HorizontalAlignment.Center);
            listView1.Columns.Add("Ngày Sinh", 190, HorizontalAlignment.Center);
            listView1.Columns.Add("Địa Chỉ", 160, HorizontalAlignment.Center);
        }

        private void bttimkiem_Click(object sender, EventArgs e)
        {
            string kn = "SELECT *FROM DOCGIA WHERE DOCGIA.HOTEN LIKE N'%" + textBox1.Text + "%' ";
            Truyxuatdulieu txdl = new Truyxuatdulieu();
            DataSet ds = txdl.getdata(kn);
            this.dataGridView1.DataSource = ds.Tables[0]; 
        }

        private void frTimKiemDocGia_Load(object sender, EventArgs e)
        {
            load_listview();
        }

    }
}
